import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import '../component/input.dart';

class Login extends StatefulWidget {
  const Login({ Key key }) : super(key: key);

  @override
  LoginState createState() => LoginState();
}

const textFieldPadding = EdgeInsets.all(8.0);
const textFieldTextStyle = TextStyle(fontSize: 30.0);

class LoginState extends State<Login> {
  // final GlobalKey<ScaffoldState> _skey = new GlobalKey<ScaffoldState>();
  bool select = false;
  // double _textWidth = 0.0;
  // double _fontSize = textFieldTextStyle.fontSize;

  @override
  Widget build(BuildContext context) {
  //密码的控制器
  // TextEditingController passController = TextEditingController();

    return new Scaffold(
      body: new Center(
        child: new Container(
          padding: const EdgeInsets.all(10),
          child: new Column(
            children: [
              new Row(
                children: [
                  new Align(
                    child: new Text('12314', style: TextStyle(color: Colors.black, textBaseline: TextBaseline.alphabetic),),
                  ),
                  new Text(select ? '已选' : '请选择', style: TextStyle(color: Colors.black, textBaseline: TextBaseline.alphabetic),),
                  new Text('12314', style: TextStyle(color: Colors.black, textBaseline: TextBaseline.alphabetic),),
                  new Radio(value: 1, groupValue: 1, onChanged: (int rval){print(rval);}),
                  new Radio(value: 2, groupValue: 2, onChanged: (int rval){print(rval);}),
                  new Radio(value: 3, groupValue: 3, onChanged: (int rval){print(rval);}),
                  new Checkbox(
                    value: select,
                    onChanged: (bool cb) {
                      setState(() {
                        select = cb;
                        print(select);
                      });
                    }
                  ),
                ]
              ),
              new ExampleWidget()
            ]
          ),
          height: 600.0
        )
      ),
      drawer: new Drawer(
        child: new ListView(
          children: <Widget>[
            new ListTile(
              title: new Text('首页'),
              trailing: new Icon(Icons.home),
              onTap: () {
                print('12314');
              },
            )
          ],
        ),
      )
    );
  }
}
